package queries;

import java.sql.SQLException;
import java.sql.Statement;

import entitys.MarketingPattern;
import enums.Result;

public class SetMarketingPatternQuery {


	public static Result exe(MarketingPattern c,java.sql.Connection conn)
	{
		Statement stmt;
		
			try {
				stmt = conn.createStatement();
			
			stmt.executeUpdate("INSERT INTO ccrm.marketingpattern (productID,fromAge,toAge,areas,significance,interestLevel,marketingAccess,messageToClient) VALUES ("+c.getProductID()+", "+c.getFromAge()+", "+c.getToAge()+", '"+c.getAreas()+"', "+c.getSignificance()+", "+c.getInterestLevel()+", "+c.getMarketingAccess()+", '"+c.getMessageToClient()+"');");
			//stmt.executeUpdate("INSERT INTO `ccrm`.`customer` (`id`,`firstName`,`lastName`,`phone`,`email`,`permit`) "
					//+ "VALUES ('"+c.getId() +"','"+c.getFirstName() +"','"+c.getLastName() +"','"+c.getPhone()+"','"+c.getEmail() +"','"+c.getPermit() +"');");
			return Result.OK;
		
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
				return Result.ERROR;
			}
		
		
	}
}
